<template>
	<view class="address-box">
		<view class="address-item" v-for="item in addressList">
			<view >
				<view>{{item.userName}} {{item.userMobile}}<span class="isDefault" v-show="item.isDefault===1?true:false">默认</span></view>
				<view>{{item.province}} {{item.city}} {{item.county}}</view>
			</view>
			
			<view style="display: flex;">
				<view style="display: flex;font-size: 24rpx;margin-right: 5rpx;"><u-icon name="edit-pen" size="30rpx"></u-icon>编辑</view>
				<view style="display: flex;font-size: 24rpx;"><u-icon name="trash" size="30rpx"></u-icon>删除</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {addressList} from "@/api/user.js"
	export default {
		data() {
			return {
				isAddress:"",
				addressList:""
			}
		},
		methods: {
			checkboxChange(n) {
				console.log('change', n);
			}
		},
		onReady() {
			//如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
			this.$refs.uForm.setRules(this.rules)
		},
		mounted() {
			addressList({
					phone:"17689292772"
				}).then((res) => {
					if (res.data.code == '0') {
						console.log(res)
						console.log(res.data.page.list)
						this.addressList=res.data.page.list;
						console.log("sdfds",this.addressList)
				}
			})
		}
	}
</script>

<style lang="scss" scoped>
	.isDefault{
		color:blue;
		font-size: 18rpx;
		background-color: whitesmoke;
		border-radius: 8rpx;
		padding: 3rpx 10rpx;
		margin-left:15rpx;
	}
	.address-item{
		border-radius: 25rpx;
		background-color: white;
		padding: 30rpx;
		margin: 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.address-box{
		
	}
</style>
